﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ForumThreadsAdmin.ascx.cs"
    Inherits="Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.Forum.ForumThreadsAdmin" %>
<p>
    <a href="../Site/ForumThreadsEdit.aspx">Thêm</a>
</p>
<owc:OwGrid ID="ForumThreadDV" runat="server" SkinID="OwGridAdmin" DataSourceID="ForumThreadOds"
    AutoGenerateColumns="False" OwEnableMessageDisplay="True" 
    OwMessageDisplayType="InPlace" OwMessageDisplayControl="">
    <MasterTableView DataSourceID="ForumThreadOds" DataKeyNames="ForumThreadID">
        <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="<%$OwR:AddNewRecordText %>" RefreshText="<%$ OwR:RefreshText %>"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
        </ExpandCollapseColumn>
        <Columns>
            <owct:GridTemplateColumn HeaderText='<%$ OwR:Code %>'>
                <ItemTemplate>
                    <%# Eval("ForumThreadID") %>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn HeaderText='<%$ OwR:TitleLabel %>'>
                <ItemTemplate>
                    <table>
                        <tr>
                            <td colspan="2">
                                <a href="#" onclick='return false;'><b><i>
                                    <%# Eval("Title")%></i>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="CreatingUserOwR" OwText="CreatingUserLabel" runat="server"></owc:OwR>
                            </td>
                            <td>
                                <%#Eval("CreatingUser") != null ? (Membership.GetUser(Eval("CreatingUser")) != null ? Membership.GetUser(Eval("CreatingUser")).UserName : "n/a") : "n/a"%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="EditingUserOwR" OwText="EditingUserLabel" runat="server"></owc:OwR>
                            </td>
                            <td>
                                <%#Eval("EditingUser") != null ? (Membership.GetUser(Eval("EditingUser")) != null ? Membership.GetUser(Eval("EditingUser")).UserName : "n/a") : "n/a"%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="OwR1" OwText="DeletingUserLabel" runat="server"></owc:OwR>
                            </td>
                            <td>
                                <%#Eval("DeletingUser") != null ? (Membership.GetUser(Eval("DeletingUser")) != null ? Membership.GetUser(Eval("DeletingUser")).UserName : "n/a") : "n/a"%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="DateTimeCreatedOwR" OwText="DateTimeCreatedLabel" runat="server"></owc:OwR>
                            </td>
                            <td>
                                <%#Eval("DateTimeCreated").OwToDateTimePublishDate()%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="DateTimeEditedOwR" OwText="LastEditedDate" runat="server"></owc:OwR>
                            </td>
                            <td>
                                <%#Eval("DateTimeEdited").OwToDateTimePublishDate()%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="EnableOwR" OwText="Enable" runat="server"></owc:OwR>
                            </td>
                            <td>
                                <owc:OwR ID="FromDateOwR" OwText="FromDate" OwSuffix=":" runat="server"></owc:OwR>
                                &nbsp;<%#Eval("EnableBegin").OwToDateTimePublishDate()%>&nbsp;
                                <owc:OwR ID="ToDateOwR" OwText="ToDate" OwSuffix=":" runat="server"></owc:OwR>
                                <%#Eval("EnableEnd").OwToDateTimePublishDate()%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="HomeDisplayOwR" OwText="HomeDisplay" runat="server"></owc:OwR>
                            </td>
                            <td>
                                <owc:OwR ID="HomeDisplayFromDateOwR" OwText="FromDate" OwSuffix=":" runat="server"></owc:OwR>
                                &nbsp;<%#Eval("HomeDisplayBegin").OwToDateTimePublishDate()%>&nbsp;
                                <owc:OwR ID="HomeDisplayToDateOwR" OwText="ToDate" OwSuffix=":" runat="server"></owc:OwR>
                                <%#Eval("HomeDisplayEnd").OwToDateTimePublishDate()%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="HostDisplayOwR" OwText="HostDisplay" runat="server"></owc:OwR>
                            </td>
                            <td>
                                <owc:OwR ID="HostDisplayFromDateOwR" OwText="FromDate" OwSuffix=":" runat="server"></owc:OwR>
                                &nbsp;<%#Eval("HotDisplayBegin").OwToDateTimePublishDate()%>&nbsp;
                                <owc:OwR ID="HostDisplayToDateOwR" OwText="ToDate" OwSuffix=":" runat="server"></owc:OwR>
                                <%#Eval("HomeDisplayEnd").OwToDateTimePublishDate()%>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn HeaderText='<%$ OwR:InfoLabel %>'>
                <ItemTemplate>
                    <table width="100%">
                        <tr>
                            <td>
                                <owc:OwR ID="DetailOwR" runat="server" OwText="DetailLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# Eval("Detail") %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="TagsOwR" runat="server" OwText="TagsLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# Eval("Tags") %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="ContinentOwR" runat="server" OwText="ContinentLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# OwLocalitiesBLL.OwGetEntity(Eval("ContinentID").OwToInt64TryParseReturn0()).Name %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="CountryOwR" runat="Server" OwText="CountryLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# OwLocalitiesBLL.OwGetEntity(Eval("CountryID").OwToInt64TryParseReturn0()).Name %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="ProvinceOwR" runat="Server" OwText="ProvinceLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# OwLocalitiesBLL.OwGetEntity(Eval("ProvinceID").OwToInt64TryParseReturn0()).Name %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="DistrictOwR" runat="Server" OwText="DistrictLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# OwLocalitiesBLL.OwGetEntity(Eval("DistrictID").OwToInt64TryParseReturn0()).Name%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="WardOwR" runat="Server" OwText="WardLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# OwLocalitiesBLL.OwGetEntity(Eval("WardID").OwToInt64TryParseReturn0()).Name%>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn HeaderText='<%$ OwR:CommandLabel %>'>
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <asp:Literal ID="EnableLabel" runat="server" Text="<%$ OwR: EnableLabel%>" />:
                            </td>
                            <td>
                                <owc:OwCheckBox ID="IsEnabledCheckBox" Enabled="False" runat="server" Checked='<%# Eval("IsEnabled") %>'
                                    Text='<%# Eval("ForumThreadID") %>' CssClass="HiddenText" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="HomeDisplayLabel" runat="server" Text="<%$ OwR: HomeDisplayLabel%>" />:
                            </td>
                            <td>
                                <owc:OwCheckBox ID="IsHomeDisplayCheckBox" runat="server" Enabled="False" Checked='<%# Eval("IsHomeDisplay") %>'
                                    Text='<%# Eval("ForumThreadID") %>' CssClass="HiddenText" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="HotLabel" runat="server" Text="<%$ OwR: HotLabel%>" />:
                            </td>
                            <td>
                                <owc:OwCheckBox ID="IsHotCheckBox" runat="server" Enabled="False" Checked='<%# Eval("IsHot") %>'
                                    Text='<%# Eval("ForumThreadID") %>' CssClass="HiddenText" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="DeletedLabel" runat="server" Text="<%$ OwR: Delete%>" />:
                            </td>
                            <td>
                                <owc:OwCheckBox ID="IsDeletedCheckBox" runat="server" Checked='<%# Eval("IsDeleted") %>'
                                    Text='<%# Eval("ForumThreadID") %>' AutoPostBack="True" CssClass="HiddenText"
                                    OnCheckedChanged="IsDeletedCheckBox_CheckedChanged" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="IsDraftOwR" runat="server" OwText="IsDraftLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <owc:OwCheckBox ID="IsDraftCheckBox" runat="server" Checked='<%# Eval("IsDraft") %>'
                                    Text='<%# Eval("ForumThreadID") %>' AutoPostBack="True" CssClass="HiddenText"
                                    OnCheckedChanged="IsDraftCheckBox_CheckedChanged" />
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn AllowFiltering="False" FilterControlAltText="Filter TemplateColumn1 column"
                UniqueName="TemplateColumn1">
                <ItemTemplate>
                    <a href='/Admin/Views/Site/ForumThreadsEdit.aspx?id=<%#Eval("ForumThreadID")%>'>
                        <img src='/App_Themes/OpenWeb/OwImages/vi-VN/CommandNameIcons/edit.gif' runat="server"
                            id="UpdateImage" alt="" /></a></ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn AllowFiltering="False" UniqueName="TemplateColumn">
                <ItemTemplate>
                    <asp:ImageButton CausesValidation="true" OnClientClick='if(!confirm("Are you sure to  Delete?")) return false'
                        ID="EditDeleteButton1" CommandName="Delete" runat="server" SkinID="OwConfirmButton"
                        ImageUrl="/App_Themes/OpenWeb/OwImages/vi-VN/CommandNameIcons/delete.gif" />
                </ItemTemplate>
            </owct:GridTemplateColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
            <FormTemplate>
                <%
                    Response.Redirect("BlogsEdit.aspx");
                %>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </HeaderContextMenu>
</owc:OwGrid>
<owc:OwObjectDataSource id="ForumThreadOds" runat="Server" 
    DataObjectTypeName="Micronet.OpenWeb.Entity.OwForumThreadsEntity" 
    DeleteMethod="OwDelete" InsertMethod="OwInsert" 
    SelectCountMethod="OwGetByDynamicCount" EnablePaging="true"
    OldValuesParameterFormatString="original_{0}" SelectMethod="OwGetByDynamic" 
    TypeName="Micronet.OpenWeb.Com.BLL.OwForumThreadsBLL" UpdateMethod="OwUpdate">
    <SelectParameters>
        <asp:Parameter Name="networkID" Type="Int64" />
        <asp:Parameter Name="portalID" Type="Int64" />
        <asp:Parameter Name="isHomeDisplay" Type="Boolean" />
        <asp:Parameter Name="isHot" Type="Boolean" />
        <asp:Parameter Name="enableBegin" Type="DateTime" />
        <asp:Parameter Name="enableEnd" Type="DateTime" />
        <asp:Parameter Name="homeDisplayBegin" Type="DateTime" />
        <asp:Parameter Name="homeDisplayEnd" Type="DateTime" />
        <asp:Parameter Name="hotDisplayBegin" Type="DateTime" />
        <asp:Parameter Name="hotDisplayEnd" Type="DateTime" />
        <asp:Parameter Name="isApproved" Type="Boolean" />
        <asp:Parameter Name="isDeleted" Type="Boolean" />
        <asp:Parameter DbType="Guid" Name="creatingUser" />
        <asp:Parameter DbType="Guid" Name="editingUser" />
        <asp:Parameter DbType="Guid" Name="deletingUser" />
        <asp:Parameter Name="continentID" Type="Int64" />
        <asp:Parameter Name="countryID" Type="Int64" />
        <asp:Parameter Name="provinceID" Type="Int64" />
        <asp:Parameter Name="districtID" Type="Int64" />
        <asp:Parameter Name="wardID" Type="Int64" />
        <asp:Parameter Name="languageCode" Type="String" />
        <asp:Parameter Name="isEnabled" Type="Boolean" />
        <asp:Parameter Name="isDraft" Type="Boolean" />
        <asp:Parameter Name="forumID" Type="Int64" />
        <asp:Parameter Name="companyID" Type="Int64" />
        <asp:Parameter Name="forumCategoryID" Type="Int64" />
        <asp:Parameter Name="threadIconID" Type="Int64" />
        <asp:Parameter Name="sortClause" Type="String" />
        <asp:Parameter Name="sortDirection" Type="String" />
        <asp:Parameter Name="startRowIndex" Type="Int32" />
        <asp:Parameter Name="maximumRows" Type="Int32" />
    </SelectParameters>
</owc:OwObjectDataSource>
